<template>
  <a-config-provider :locale="zhCN">
    <a-spin :spinning="loading" :tip="tip" size="large" wrapper-class-name="ant-loading" style="max-height: 100%">
      <router-view />
    </a-spin>
  </a-config-provider>
</template>

<script setup>
import useSettingsStore from '@/store/modules/settings'
import useLoadingStore from '@/store/modules/loading'
import { handleThemeStyle } from '@/utils/theme'
import zhCN from 'ant-design-vue/es/locale/zh_CN';

onMounted(() => {
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme)
  })
})

const loadingStore = useLoadingStore();
const { loading, tip } = storeToRefs(loadingStore);
</script>
<style lang="scss" scoped>
.ant-loading {
  height: 100%;
  &>::v-deep(.ant-spin-container) {
    height: 100%;
  }
}
</style>
